/* ===================================
Michal Kowalczyk
2010 EZI
==================================== */

#pragma once


class MoveTo: public Process
{
private:
	EntityPtr tmpEntity;
	int m_id;
	float v, tx, tz, destx, destz;
	bool xreached, zreached;
	bool silentMove;
	const int skips;
	int currentSkip;
	int region;
public:
	MoveTo(int id, float x, float z, bool silent = false, float _v = 0.5f): m_id(id), v(_v), destx(x), destz(-z), \
		xreached(false), zreached(false), silentMove(silent), skips(24)
	{
		currentSkip = 0;
		tmpEntity = entityManager.getEntity(m_id);
		region = tmpEntity->getRegion();
	};
	void update();
};

class waitProcess: public Process
{
private:
	unsigned int m_start;
	unsigned int m_stop;
public:
	waitProcess(unsigned int msec): m_start(0), m_stop(msec) {};
	void update();
};

class emptyProcess: public Process
{
private:
public:
	emptyProcess()
	{

	}
	void update() {

	};
};

class jump: public Process
{
private:
	int m_id;
	int m_count, tmpCount;
	float m_height;
	float v, x, z;
	float ground, tmpHeight;
	EntityPtr tmpEntity;
	bool up;
public:
	jump(int id, float height, int count = 1, float velocity = 0.8f): m_id(id), v(velocity), m_count(count)
	{
		up = true;
		tmpCount = 1;
		tmpEntity = entityManager.getEntity(m_id);
		x = tmpEntity->getPosition3D().x;
		z = -tmpEntity->getPosition3D().z;
		ground = Renderer::Instance().getMOS_Structure()->getHeight(x,z) + 1.0f;
		tmpHeight = ground;
		m_height = ground + height;
	};
	void update();
};